import { lazy } from "react"
import {Navigate} from "react-router-dom"
import { FriendsO, HomeO, Search, SettingO } from '@react-vant/icons'
const Login = lazy(()=>import("../pages/Login"))
const Home = lazy(()=>import("../pages/Home/Home"))
const ShopHome = lazy(()=>import("../pages/Home/Index"))
const Shopcar = lazy(()=>import("../pages/Home/Shopcar"))
const Detail = lazy(()=>import("../pages/Deatil"))
const Floor = lazy(()=>import("../pages/Floor"))
const Address = lazy(()=>import("../pages/Home/Address"))
const Addaddress = lazy(()=>import("../pages/Home/Addaddress"))
export const homerouter = [
    {
        path:"/home/index",
        element:<ShopHome></ShopHome>,
        tit:"首页",
        icon:<HomeO />
    },
    {
        path:"/home/shopcar",
        element:<Shopcar></Shopcar>,
        tit:"购物车",
        icon:<FriendsO/>
    },
    {
        path:'/home',
        element:<Navigate to="/home/index"></Navigate>
    },
    {
       path:"/home/address",
       element:<Address></Address>,
       tit:'地址',
       icon:<SettingO/>
    },
 

]
const routerconfig = [
    {
        path:"/login",
        element:<Login></Login>
    },
    {
        path:"/home",
        element:<Home></Home>,
        children:homerouter
    },
    {
        path:"/detail",
        element:<Detail></Detail>
    },
    {
        path:"/floor",
        element:<Floor></Floor>
    },
    {
        path:"/addaddress",
        element:<Addaddress></Addaddress>
    },
    {
        path:'/',
        element:<Navigate to="/home"></Navigate>
    }
]
export default routerconfig